package com.xmtlxx.wms.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.wms.domain.InventoryPlan;
import com.xmtlxx.wms.domain.bo.InventoryPlanDeleteBo;
import com.xmtlxx.wms.domain.bo.InventoryPlanProExportBo;
import com.xmtlxx.wms.domain.vo.*;
import com.xmtlxx.wms.domain.bo.InventoryPlanBo;
import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.InventoryPlan;
import com.xmtlxx.wms.domain.bo.InventoryPlanBo;
import com.xmtlxx.wms.domain.vo.InventoryDtlVo;
import com.xmtlxx.wms.domain.vo.InventoryPlanVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 盘点计划Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface InventoryPlanMapper extends BaseMapperPlus<InventoryPlanMapper, InventoryPlan, InventoryPlanVo> {

    /**
     * 根据条件分页查询盘点计划
     *
     * @param inventoryPlan 盘点计划
     * @return Page InventoryPlan
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "i.create_by"),
//        @DataColumn(key = "deptName", value = "i.dept_id"),
//        @DataColumn(key = "userName", value = "i.create_by")
//    })
    Page<InventoryPlanVo> selectPageInventoryPlanList(@Param("page") Page<InventoryPlan> page, @Param("inventoryPlan") InventoryPlanBo inventoryPlan);

    /**
     * 查询盘点计划列表
     *
     * @param inventoryPlan 盘点计划
     * @return 盘点计划集合
     */
    @DataPermission({
            @DataColumn(key = "tenantName", value = "i.create_by"),
            @DataColumn(key = "deptName", value = "i.dept_id"),
            @DataColumn(key = "userName", value = "i.create_by")
    })
    List<InventoryPlanVo> selectInventoryPlanList(@Param("inventoryPlan") InventoryPlanBo inventoryPlan);

    InventoryPlanVo selectInventoryPlanVoByID(String id);

    Long selectCountAlls();

    List<InventoryDtlVo> queryPlanProList(@Param("id") String id);

    /**
     * @param bo
     * @return
     */
    List<InventoryPlanProExportVo> getInventoryPlanExportList(@Param("bo") InventoryPlanProExportBo bo);

    List<InventoryPlanStatisticsExportVo> getInventoryPlanStatisticsExportList(@Param("bo") InventoryPlanProExportBo bo);

    Boolean deletePlanProByPnos(@Param("bo") InventoryPlanDeleteBo bo);
    void updatePlanBooksByNo(@Param("no") String no);
    void updatePlanNumsByNo(@Param("no") String no);
    void updatePlanResultByNo(@Param("no") String no);
}
